import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-07-04
 * Time: 14:29
 */
public class Test20 {

    public static void rotate(int[][] num) {
        int n = num.length;
        //1.对角线
        for(int i = 0; i < n; i++) {
            for(int j = i+1; j < n; j++) {
                int tmp = num[i][j];
                num[i][j] = num[j][i];
                num[j][i] = tmp;
            }
        }
        //2.中心交换
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n/2; j++) {
                int tmp = num[i][j];
                num[i][j] = num[i][n-j-1];
                num[i][n-j-1] = tmp;
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] num = new int[n][n];
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                num[i][j] = sc.nextInt();
            }
        }
        rotate(num);
        //格式化输入
        System.out.print("[");
        for(int i = 0; i < n; i++) {
            System.out.print("[");
            for(int j = 0; j < n; j++) {
                System.out.print(num[i][j]);
                if(j < n-1) {
                    System.out.print(",");
                }
            }
            System.out.print("]");
            if(i < n-1) {
                System.out.print(",");
            }
        }
        System.out.print("]");
    }
}
